﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VB2CS
{
    public sealed class  ParamsArrayUtils
    {
        /// <summary>
        /// Help to migrate the function which depend on the ablity of using defaut params value in VB language
        /// </summary>
        /// <param name="source">the params array pass by called </param>
        /// <param name="target">the list of all the params which has default value</param>
        /// <remarks>The target list sequence should be the same as they are in the function declaration</remarks>
        public static void FillParamsArray(object[] source,object[] target)
        {
            if (source.Length>target.Length) throw new System.InvalidOperationException("The length of target should be less than source");
            for (int i = 0; i <source.Length; ++i)
            {
                target[i] = source[i];
            }
        }
    }
}
